from app import db

class UserDiseases(db.Model):
    __tablename__ = 'user_diseases'

    user_id = db.Column(db.String(255), db.ForeignKey('user_info.user_id'), primary_key=True)
    disease_id = db.Column(db.Integer, db.ForeignKey('diseases.disease_id'), primary_key=True)

    user = db.relationship('UserInfo', backref='user_diseases')
    disease = db.relationship('Diseases', backref='user_diseases')

    def __repr__(self):
        return f'<UserDiseases user_id={self.user_id}, disease_id={self.disease_id}>'
